package com.tzbank.fingerPrint.service.impl;

import java.util.Calendar;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.apache.commons.lang.StringUtils;
import org.apache.commons.lang3.StringEscapeUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.alipay.api.AlipayApiException;
import com.alipay.api.AlipayClient;
import com.alipay.api.DefaultAlipayClient;
import com.alipay.api.request.AlipaySecurityProdFingerprintApplyInitializeRequest;
import com.alipay.api.request.AlipaySecurityProdFingerprintApplyRequest;
import com.alipay.api.request.AlipaySecurityProdFingerprintDeleteRequest;
import com.alipay.api.request.AlipaySecurityProdFingerprintVerifyInitializeRequest;
import com.alipay.api.request.AlipaySecurityProdFingerprintVerifyRequest;
import com.alipay.api.response.AlipaySecurityProdFingerprintApplyInitializeResponse;
import com.alipay.api.response.AlipaySecurityProdFingerprintApplyResponse;
import com.alipay.api.response.AlipaySecurityProdFingerprintDeleteResponse;
import com.alipay.api.response.AlipaySecurityProdFingerprintVerifyInitializeResponse;
import com.alipay.api.response.AlipaySecurityProdFingerprintVerifyResponse;
import com.tzbank.fingerPrint.dao.FingerPrintMapper;
import com.tzbank.fingerPrint.entity.FingerPrintFlowRecord;
import com.tzbank.fingerPrint.entity.FingerPrintInformation;
import com.tzbank.fingerPrint.entity.FingerPrintModel;
import com.tzbank.fingerPrint.service.FingerPrintService;
import com.tzbank.redis.RedisUtils;
import com.tzbank.utils.CodeUtil;
import com.tzbank.utils.ResultUtil;

import lombok.extern.slf4j.Slf4j;

@Service(value = "fingerPrintService")
@Slf4j
public class FingerPrintServiceImpl implements FingerPrintService {

	@Autowired
	private FingerPrintMapper fingerPrintMapper;

	private String SERVERURL = "";
	private String APP_ID = "";
	private String RSAPRIVATEKEY = "";
	private String FORMAT = "";
	private String ALIPAYPUBLICKEY = "";
	private String CHARSET = "";
	private String SIGNTYPE = "";

	/**
	 * 获取配置参数
	 * 
	 * @return
	 */
	public void getFingerPrintConfig() {
		SERVERURL = RedisUtils.getValue("FINGERPRINT_SERVERURL");
		APP_ID = RedisUtils.getValue("FINGERPRINT_APP_ID");
		RSAPRIVATEKEY = RedisUtils.getValue("FINGERPRINT_RSAPRIVATEKEY");
		FORMAT = RedisUtils.getValue("FINGERPRINT_FORMAT");
		ALIPAYPUBLICKEY = RedisUtils.getValue("FINGERPRINT_ALIPAYPUBLICKEY");
		CHARSET = RedisUtils.getValue("FINGERPRINT_CHARSET");
		SIGNTYPE = RedisUtils.getValue("FINGERPRINT_SIGNTYPE");
	}

	/**
	 * 3.2指纹注册初始化 接口:alipay.security.prod.fingerprint.apply.initialize
	 * 
	 * @return
	 * @throws AlipayApiException
	 *
	 */
	@Transactional
	public Map<String, Object> fingerPrintApplyItialize(FingerPrintModel vo) {
		log.info("---------->指纹注册初始化----->begin参数"+vo.getDeviceId()+"userId:"+vo.getUserId());
		//如果没有开通记录发起注册
		FingerPrintInformation a  = new FingerPrintInformation();
		a.setAuth_type(vo.getAuth_type());
		a.setDeviceid(vo.getDeviceId());
		a.setOperatingUser(vo.getUserId());
		List<FingerPrintInformation> list = fingerPrintMapper.findFingerPrintApplyItialize(a);
		if(!list.isEmpty()) {		
			Map<String, String> mapToken = new HashMap<>();
			mapToken.put("ai_token", list.get(0).getToken());	
			return ResultUtil.resultMap("指纹注册已注册！！", "10005",  JSONObject.toJSON(mapToken).toString());
		}
		// 获取配置参数
		getFingerPrintConfig();
		// 提取所需的业务参数
		Map<String, String> map = new HashMap<>();
		if (StringUtils.isNotEmpty(vo.getSec_data())) {
			map.put("sec_data", vo.getSec_data());
		}
		map.put("auth_type", vo.getAuth_type());
		map.put("ifaa_version", vo.getIfaa_version());
		JSONObject itemJSONObj = JSONObject.parseObject(JSON.toJSONString(map));
		// 将业务参数转化为所需的Json字符串。
		String bizContent = itemJSONObj.toString();
		// 通过SDK建立指纹注册请求
		AlipaySecurityProdFingerprintApplyInitializeRequest request = new AlipaySecurityProdFingerprintApplyInitializeRequest();
		request.setBizContent(bizContent);
		// 执行指纹注册初始化接口
		AlipaySecurityProdFingerprintApplyInitializeResponse response = null;
		// 操作流水记录
		FingerPrintFlowRecord fingerPrintFlowRecord = new FingerPrintFlowRecord();
		fingerPrintFlowRecord.setOperatingUser(vo.getUserId());// 操作用户'
		fingerPrintFlowRecord.setRequesSource(vo.getRequestSource());// 请求来源
		fingerPrintFlowRecord.setCorrespondingInterface("指纹注册初始化");// 对应接口
		fingerPrintFlowRecord.setRequestParameters(bizContent);// 请求参数
		fingerPrintFlowRecord.setConsumerSeqNo(vo.getConsumerSeqNo());
		//20180628//新加
		fingerPrintFlowRecord.setAddress(vo.getAddress());//地址
		fingerPrintFlowRecord.setBusinessScenario(vo.getBusinessScenario());//业务场景
		//20180628//结束
		// 获取返回信息
		Map<String, String> result = new HashMap<String, String>();
		String code = "";
		String msg = "";
		try {
			AlipayClient alipayClient = new DefaultAlipayClient(SERVERURL, APP_ID, RSAPRIVATEKEY, FORMAT, CHARSET,
					ALIPAYPUBLICKEY, SIGNTYPE);

			response = alipayClient.execute(request);
			if (response.isSuccess()) {
				code = CodeUtil.CODE_200.getCode();
				msg = CodeUtil.CODE_200.getName() + "--" + response.getMsg();
				result.put("ifaf_message", response.getServerResponse());
				log.info("---------->3.2 指纹注册初始化----->调用成功");
			} else {
				code = CodeUtil.CODE_500.getCode();
				msg = CodeUtil.CODE_500.getName() + "--" + response.getMsg();
				log.info("---------->3.2 指纹注册初始化----->调用失败>",msg);
			}

			// 操作流水记录
			fingerPrintFlowRecord
					.setResponseResult("[" + msg + "---" + code + "---" + JSONObject.toJSON(result).toString() + "]");// 返回结果
			insertRecord(fingerPrintFlowRecord);
		} catch (Exception e) {
			// 操作流水记录
			fingerPrintFlowRecord.setResponseResult("[指纹注册初始化~---500]");// 返回结果
			insertRecord(fingerPrintFlowRecord);
			log.info("---------->指纹注册初始化-----异常报错---->end>",e);
			return ResultUtil.resultMap("指纹注册初始化失败", "500", null);

		}
		log.info("---------->指纹注册初始化----成功运行--->end");
		return ResultUtil.resultMap(msg, code, JSONObject.toJSON(result).toString());
	}

	/**
	 * 3.3指纹注册接口 接口:alipay.security.prod.fingerprint.apply
	 * 
	 * @return
	 * @throws AlipayApiException
	 *
	 */
	@Transactional
	public Map<String, Object> fingerPrintApply(FingerPrintModel vo) {
		log.info("---------->指纹注册接口----->begin参数"+vo.getDeviceId()+"userId:"+vo.getUserId());
		// 获取配置参数
		getFingerPrintConfig();
		// 提取所需的业务参数
		Map<String, String> map = new HashMap<>();
		map.put("out_biz_no", vo.getOut_biz_no());
		map.put("ifaa_version", vo.getIfaa_version());
		map.put("ifaf_message", vo.getIfaf_message());
		JSONObject itemJSONObj = JSONObject.parseObject(JSON.toJSONString(map));
		// 将业务参数转化为所需的Json字符串。
		String bizContent = itemJSONObj.toString();
		// 转义之后的字符串
		bizContent = StringEscapeUtils.unescapeJava(bizContent);
		// 建立指纹注册请求
		AlipaySecurityProdFingerprintApplyRequest request = new AlipaySecurityProdFingerprintApplyRequest();
		request.setBizContent(bizContent);
		// 操作流水记录
		FingerPrintFlowRecord fingerPrintFlowRecord = new FingerPrintFlowRecord();
		fingerPrintFlowRecord.setOperatingUser(vo.getUserId());// 操作用户'
		fingerPrintFlowRecord.setRequesSource(vo.getRequestSource());// 请求来源
		fingerPrintFlowRecord.setCorrespondingInterface("指纹注册接口");// 对应接口
		fingerPrintFlowRecord.setRequestParameters(bizContent);// 请求参数
		fingerPrintFlowRecord.setConsumerSeqNo(vo.getConsumerSeqNo());
		//20180628//新加
		fingerPrintFlowRecord.setAddress(vo.getAddress());//地址
		fingerPrintFlowRecord.setBusinessScenario(vo.getBusinessScenario());//业务场景
		//20180628//结束
		// 执行指纹注册接口
		AlipaySecurityProdFingerprintApplyResponse response = null;
		Map<String, String> result = new HashMap<String, String>();
		String code = "";
		String msg = "";
	
		try {
			AlipayClient alipayClient = new DefaultAlipayClient(SERVERURL, APP_ID, RSAPRIVATEKEY, FORMAT, CHARSET,
					ALIPAYPUBLICKEY, SIGNTYPE);
			response = alipayClient.execute(request);
			// 获取返回信息
			if (response.isSuccess()) {
				code = CodeUtil.CODE_200.getCode();
				msg = CodeUtil.CODE_200.getName() + "--" + response.getMsg();
				result.put("auth_type", response.getAuthType());
				result.put("device_id", response.getDeviceId());
				result.put("token", response.getToken());
				log.info("---------->指纹注册接口接口----->调用成功");		
				
				//存储开通记录--->token				
				FingerPrintInformation a  = new FingerPrintInformation();
				a.setAuth_type(response.getAuthType());//
				a.setDeviceid(vo.getDeviceId());//
				a.setOperatingUser(vo.getUserId());//
				a.setToken(response.getToken());//
				a.setCorrespondingInterface("指纹注册接口");
				a.setConsumer_seq_no(vo.getConsumerSeqNo());
				a.setRequesSource(vo.getRequestSource());
				int count=fingerPrintMapper.checkExist(a);
				
				if(count==0) {
					fingerPrintMapper.intoFingerPrintApply(a);//新增操作
				}else {
					fingerPrintMapper.updateFingerPrint(a);//更新 状态的更新成可用
				}
					
			} else {
				code = CodeUtil.CODE_500.getCode();
				msg = CodeUtil.CODE_500.getName() + "--" + response.getMsg();
				log.info("---------->指纹注册接口接口----->调用失败>",msg);
			}
			// 操作流水记录
			fingerPrintFlowRecord
					.setResponseResult("[" + msg + "---" + code + "---" + JSONObject.toJSON(result).toString() + "]");// 返回结果
			insertRecord(fingerPrintFlowRecord);
		
		} catch (Exception e) {
			// 操作流水记录
			fingerPrintFlowRecord.setResponseResult("[指纹注册失败~---500]");// 返回结果
			insertRecord(fingerPrintFlowRecord);
			log.info("---------->指纹注册接口-----异常报错---->end>",e);
			return ResultUtil.resultMap("指纹注册失败", "500", null);
		}
		log.info("---------->指纹注册接口----成功运行--->end");
		return ResultUtil.resultMap(msg, code, JSONObject.toJSON(result).toString());
	}

	/**
	 * 3.4指纹校验初始化接口 接口:alipay.security.prod.fingerprint.verify.initialize
	 * 
	 * @return
	 * @throws AlipayApiException
	 *
	 */
	@Transactional
	public Map<String, Object> fingerPrintVerifyInitialize(FingerPrintModel vo) {
		log.info("---------->指纹校验初始化接口 接口----->begin参数");
		//根据设备信息获取token
		FingerPrintInformation a  = new FingerPrintInformation();
		a.setAuth_type(vo.getAuth_type());
		a.setDeviceid(vo.getDeviceId());
		a.setOperatingUser(vo.getUserId());
		List<FingerPrintInformation> list = fingerPrintMapper.findFingerPrintToken(a);
		if(list.size()>0) {			
			vo.setAi_token(	list.get(0).getToken() );
		}else {
			return ResultUtil.resultMap("指纹失效，请重新注册！", "500", null);
		}
			
		getFingerPrintConfig();
		log.info("---------->指纹校验初始化接口----->begin");
		// 获取配置参数
		// 提取所需的业务参数
		Map<String, String> map = new HashMap<>();
		
		map.put("token", vo.getAi_token());
		
		map.put("ifaa_version", vo.getIfaa_version());
		JSONObject itemJSONObj = JSONObject.parseObject(JSON.toJSONString(map));
		// 将业务参数转化为所需的Json字符串。
		String bizContent = itemJSONObj.toString();
		// 建立指纹校验初始化接口请求
		AlipaySecurityProdFingerprintVerifyInitializeRequest request = new AlipaySecurityProdFingerprintVerifyInitializeRequest();
		request.setBizContent(bizContent);
		// 执行指纹注册接口
		AlipaySecurityProdFingerprintVerifyInitializeResponse response = null;
		Map<String, String> result = new HashMap<String, String>();
		// 操作流水记录
		FingerPrintFlowRecord fingerPrintFlowRecord = new FingerPrintFlowRecord();
		fingerPrintFlowRecord.setOperatingUser(vo.getUserId());// 操作用户'
		fingerPrintFlowRecord.setRequesSource(vo.getRequestSource());// 请求来源
		fingerPrintFlowRecord.setCorrespondingInterface("指纹校验初始化接口");// 对应接口
		fingerPrintFlowRecord.setRequestParameters(bizContent);// 请求参数
		fingerPrintFlowRecord.setConsumerSeqNo(vo.getConsumerSeqNo());
		//20180628//新加
		fingerPrintFlowRecord.setAddress(vo.getAddress());//地址
		fingerPrintFlowRecord.setBusinessScenario(vo.getBusinessScenario());//业务场景
		//20180628//结束
		// 获取返回信息
		String code = "";
		String msg = "";
		try {
			AlipayClient alipayClient = new DefaultAlipayClient(SERVERURL, APP_ID, RSAPRIVATEKEY, FORMAT, CHARSET,
					ALIPAYPUBLICKEY, SIGNTYPE);

			response = alipayClient.execute(request);
			if (response.isSuccess()) {
				code = CodeUtil.CODE_200.getCode();
				msg = CodeUtil.CODE_200.getName() + "--" + response.getMsg();
				result.put("ifaf_message", response.getServerResponse());
				log.info("---------->指纹校验初始化接口----->调用成功");

			} else {
				code = CodeUtil.CODE_500.getCode();
				msg = CodeUtil.CODE_500.getName() + "--" + response.getMsg();
				log.info("---------->指纹校验初始化接口----->调用失败>",msg);
			}
			// 操作流水记录
			fingerPrintFlowRecord
					.setResponseResult("[" + msg + "---" + code + "---" + JSONObject.toJSON(result).toString() + "]");// 返回结果
			insertRecord(fingerPrintFlowRecord);

		} catch (Exception e) {
			// 操作流水记录
			fingerPrintFlowRecord.setResponseResult("[指纹校验初始化失败~---500]");// 返回结果
			insertRecord(fingerPrintFlowRecord);
			log.info("---------->指纹校验初始化接口-----异常报错---->end",e);
			return ResultUtil.resultMap("指纹校验初始化失败", "500", null);
		}
		log.info("---------->指纹校验初始化接口----成功运行--->end");
		return ResultUtil.resultMap(msg, code, JSONObject.toJSON(result).toString());
	}

	/**
	 * 3.5指纹校验接口 接口:alipay.security.prod.fingerprint.verify
	 * 
	 * @return
	 * @throws AlipayApiException
	 *
	 */
	@Transactional
	public Map<String, Object> fingerPrintVerify(FingerPrintModel vo) {
		// 获取配置参数
		getFingerPrintConfig();
		log.info("---------->指纹校验接口----->begin");
		// 提取所需的业务参数
		Map<String, String> map = new HashMap<>();
		map.put("ifaf_message", vo.getIfaf_message());
		map.put("out_biz_no", vo.getOut_biz_no());
		map.put("ifaa_version", vo.getIfaa_version());
		map.put("extend_param", "{\\\"needAuthData\\\": " + vo.isNeedAuthData() + ",\\\"subAction\\\": \\\""
				+ vo.getSubAction() + "\\\"}");
		JSONObject itemJSONObj = JSONObject.parseObject(JSON.toJSONString(map));
		// 将业务参数转化为所需的Json字符串。
		String bizContent = itemJSONObj.toString();
		// 转义之后的字符串
		bizContent = StringEscapeUtils.unescapeJava(bizContent);
		// 建立指纹校验接口请求
		AlipaySecurityProdFingerprintVerifyRequest request = new AlipaySecurityProdFingerprintVerifyRequest();
		request.setBizContent(bizContent);
		// 操作流水记录
		FingerPrintFlowRecord fingerPrintFlowRecord = new FingerPrintFlowRecord();
		fingerPrintFlowRecord.setOperatingUser(vo.getUserId());// 操作用户'
		fingerPrintFlowRecord.setRequesSource(vo.getRequestSource());// 请求来源
		fingerPrintFlowRecord.setCorrespondingInterface("指纹校验接口");// 对应接口
		fingerPrintFlowRecord.setRequestParameters(bizContent);// 请求参数
		fingerPrintFlowRecord.setConsumerSeqNo(vo.getConsumerSeqNo());
		//20180628//新加
		fingerPrintFlowRecord.setAddress(vo.getAddress());//地址
		fingerPrintFlowRecord.setBusinessScenario(vo.getBusinessScenario());//业务场景
		//20180628//结束
		// 执行指纹注册接口
		AlipaySecurityProdFingerprintVerifyResponse response = null;
		Map<String, String> result = new HashMap<String, String>();
		// 获取返回信息
		String code = "";
		String msg = "";
		try {
			AlipayClient alipayClient = new DefaultAlipayClient(SERVERURL, APP_ID, RSAPRIVATEKEY, FORMAT, CHARSET,
					ALIPAYPUBLICKEY, SIGNTYPE);
			response = alipayClient.execute(request);
			if (response.isSuccess()) {
				code = CodeUtil.CODE_200.getCode();
				msg = CodeUtil.CODE_200.getName() + "--" + response.getMsg();
				result.put("auth_result", response.getAuthResult().toString());
				result.put("token", response.getToken());
				log.info("---------->指纹校验接口----->调用成功");
			} else {
				code = CodeUtil.CODE_500.getCode();
				msg = CodeUtil.CODE_500.getName() + "--" + response.getMsg();
				log.info("---------->指纹校验接口----->调用失败==>",msg);
			}
			// 操作流水记录

			fingerPrintFlowRecord
					.setResponseResult("[" + msg + "---" + code + "---" + JSONObject.toJSON(result).toString() + "]");// 返回结果
			insertRecord(fingerPrintFlowRecord);
		} catch (Exception e) {
			// 操作流水记录
			fingerPrintFlowRecord.setResponseResult("[指纹校验初始化失败~---500]"+e.getMessage());// 返回结果
			insertRecord(fingerPrintFlowRecord);
			log.info("---------->指纹校验接口-----异常报错---->end>",e);
			return ResultUtil.resultMap("指纹校验初始化失败", "500", null);
		}
		log.info("---------->指纹校验接口---成功运行-->end");
		return ResultUtil.resultMap(msg, code, JSONObject.toJSON(result).toString());
	}

	/**
	 * 3.6 指纹注销接口 接口:alipay.security.prod.fingerprint.delete
	 * 
	 * @return
	 * @throws AlipayApiException
	 *
	 */
	@Transactional
	public Map<String, Object> fingerPrintDelete(FingerPrintModel vo) {
		log.info("---------->指纹注销接口----->begin");
		//根据设备信息获取token
		FingerPrintInformation a  = new FingerPrintInformation();
		a.setAuth_type(vo.getAuth_type());
		a.setDeviceid(vo.getDeviceId());
		a.setOperatingUser(vo.getUserId());
		List<FingerPrintInformation> list = fingerPrintMapper.findFingerPrintToken(a);
		if(!list.isEmpty()) {			
			vo.setAi_token(	list.get(0).getToken() );
		}else {
			return ResultUtil.resultMap("指纹已注销！", "200", null);
		}
		// 获取配置参数
		getFingerPrintConfig();
		// 提取所需的业务参数
		Map<String, String> map = new HashMap<>();
		map.put("token", vo.getAi_token());
		map.put("ifaa_version", vo.getIfaa_version());
		JSONObject itemJSONObj = JSONObject.parseObject(JSON.toJSONString(map));
		// 将业务参数转化为所需的Json字符串。
		String bizContent = itemJSONObj.toString();
		// 建立指纹注销接口请求
		AlipaySecurityProdFingerprintDeleteRequest request = new AlipaySecurityProdFingerprintDeleteRequest();
		request.setBizContent(bizContent);
		// 执行指纹注销接口
		AlipaySecurityProdFingerprintDeleteResponse response = null;
		// 操作流水记录
		FingerPrintFlowRecord fingerPrintFlowRecord = new FingerPrintFlowRecord();
		fingerPrintFlowRecord.setOperatingUser(vo.getUserId());// 操作用户'
		fingerPrintFlowRecord.setRequesSource(vo.getRequestSource());// 请求来源
		fingerPrintFlowRecord.setCorrespondingInterface("指纹注销接口");// 对应接口
		fingerPrintFlowRecord.setRequestParameters(bizContent);// 请求参数
		fingerPrintFlowRecord.setConsumerSeqNo(vo.getConsumerSeqNo());
		//20180628//新加
		fingerPrintFlowRecord.setAddress(vo.getAddress());//地址
		fingerPrintFlowRecord.setBusinessScenario(vo.getBusinessScenario());//业务场景
		//20180628//结束
		// 获取返回信息
		Map<String, String> result = new HashMap<String, String>();
		String code = "";
		String msg = "";
		try {
			AlipayClient alipayClient = new DefaultAlipayClient(SERVERURL, APP_ID, RSAPRIVATEKEY, FORMAT, CHARSET,
					ALIPAYPUBLICKEY, SIGNTYPE);
			response = alipayClient.execute(request);
			if (response.isSuccess()) {
				code = CodeUtil.CODE_200.getCode();
				msg = CodeUtil.CODE_200.getName() + "--" + response.getMsg();
				result.put("ifaf_message", response.getServerResponse());
				log.info("---------->指纹注销接口----->调用成功");
				//删除token--->token				
				FingerPrintInformation b  = new FingerPrintInformation();	
				b.setDeviceid(vo.getDeviceId());//
				b.setOperatingUser(vo.getUserId());//			
				b.setRequesSource(vo.getRequestSource());
				fingerPrintMapper.deleteFingerPrint(b);	
				
			} else {
				code = CodeUtil.CODE_500.getCode();
				msg = CodeUtil.CODE_500.getName() + "--" + response.getMsg();
				log.info("---------->指纹注销接口----->调用失败>",msg);
			}

			fingerPrintFlowRecord
					.setResponseResult("[" + msg + "---" + code + "---" + JSONObject.toJSON(result).toString() + "]");// 返回结果
			insertRecord(fingerPrintFlowRecord);

		} catch (Exception e) {
			fingerPrintFlowRecord.setResponseResult("[指纹注销失败~---500]");// 返回结果
			insertRecord(fingerPrintFlowRecord);
			log.info("---------->指纹注销接口-----异常报错---->end>",e);
			return ResultUtil.resultMap("指纹注销失败", "500", null);
		}
		log.info("---------->指纹注销接口--成功运行-->end");
		return ResultUtil.resultMap(msg, code, JSONObject.toJSON(result).toString());
	}

	/**
	 * 插入记录
	 * 
	 */
	public void insertRecord(FingerPrintFlowRecord fingerPrintFlowRecord) {

		Calendar cal = Calendar.getInstance();
		fingerPrintFlowRecord.setYear(String.valueOf(cal.get(Calendar.YEAR)));
		fingerPrintFlowRecord.setMonth(String.valueOf(cal.get(Calendar.MONTH) + 1));
		fingerPrintMapper.intoFingerPrintLog(fingerPrintFlowRecord);
	}

}
